
				*** Rallying Fiscal Patriotism ***
				
/* Code for reproducing main text output and descriptives for the article
	"Rallying Fiscal Patriotism: War Taxes in the Contemporary World",
				Comparative Political Studies.
 
 */
 
 
 
 
 
 
 
 
				
***** FIGURES *******  




*** Figure 1. World map, coverage and introductions [See map folder]

	/* World Map based on boundary files from IPUMS International 2020
	https://international.ipums.org/international/gis.shtml [accessed: Feb. 2023]
	Converted into Stata readable format using shp2dta command and merged
	with War Tax data (1.0) collapsed on individual countries.
	*/

use "wtmapmerged.dta", clear

* if needed: [ssc install spmap]*

 spmap wtcount using "worldcoord" if CNTRY_NAME!="Antarctica", id(id) /// 
  clmethod(unique) ndlabel("N/A") ndsize(0.03) ndocolor(gs10) osize(0.10 ..) ocolor(gs1 ..)  ///
  fcolor(gs15*0.5 "250 218 94" "252 162 63" "253 107 31" "255 51 0") ///
  plotregion(margin(-40 0 -10 -10)) ///
  legorder(hilo) legend(size(medlarge) ring(0) position(8) bmargin(25 1 3 1)) ///
  note(`"Number of war taxes by country, 1960-2022."' `"Note: border changes not accounted for. Source: War Tax dataset 1.0 (2022)"', size(2.5) ring(0) pos(8) margin(65 1 3 1))

graph export "Figure 1. War tax coverage (map).png", width(5000) replace





*** Figure 2. War tax introduction over time 

use "War Tax Dataset 1.0.dta", clear

		*Generate extended end-variables
		gen conflict_endplus1=conflict_end+1 if conflict_end!=2020
		recode conflict_endplus1 .=2020

		gen year_last_knownplus1 = year_last_known+1 if year_last_known!=2020
		recode year_last_knownplus1 .=2020


twoway (rbar conf_start_trunc conflict_endplus1 introid, horizontal yscale(rev) ///
 ymtick(1(1)68, nogrid) ylabel(1(0)68)  ///
xlabel(1960 (10) 2020, labsize(small)) barwidth(0.8) color(gs10) fi(inten100) ///
 ytitle("") xtick(1960(5)2020) scheme(s1mono) ///
plotregion(margin(0.5 0.5 1 1)) graphregion(margin(0 5 5 5)) ///
 legend(order(2 "War tax in effect" 1 "Conflict episode") ///
 size(small) symysize(1pt)) note("Note: The figure includes all 68 war taxes, each represented by a horizontal line," "ordered chronologically in descending order, by year of introduction." "Source: War Tax dataset 1.0 (2022)", size(2.0)))  ///
(rbar year_intro year_last_knownplus1 introid, horizontal color(black) fi(inten100) barwidth(0.3))

graph export "Figure 2. Introductions and duration of war taxes over time.png", width(5000) replace





*** Figure 3. War Taxes, by timing of introduction


use "War Tax Dataset 1.0.dta", clear



		*Generate extended end-variables
		gen conflict_endplus1=conflict_end+1 if conflict_end!=2020
		recode conflict_endplus1 .=2020
		gen year_last_knownplus1 = year_last_known+1 if year_last_known!=2020
		recode year_last_knownplus1 .=2020
	 
	 
		* Generating new variables centered on introduction
		gen cstart2=0  
		gen cend2=conflict_endplus1-conflict_start
		gen yintro2=year_intro-conflict_start
		gen ylast2=year_last_knownplus1-conflict_start


	
		*New case-identifier (n) ranked according to time of introduction in
		* relation to conflict onset
		sort intro_confstart year_intro country_name
		gen n=_n
		sort n
	

* Using the new, labeled "case-identifier" as Y variable 
* But first have to select which cases to highlight


* The following taxes are explicitly brought up in the text; now having these intro-values (n)
/* 

-  Taxid 28 - Ethiopia: Income War Levy = 63
-  Taxid 37 - Israel: Security Levy = 4
-  Taxid 63 - Sudan: Defence and Security Tax = 1

*/


		*Creating a variable identifying highlighted countries
		gen case=0
		replace case=1 if taxid==28 | taxid==37 | taxid==63


		*Generating a string to attach as labels to the sort-variable (n)
		*Country - taxid# 
		tostring taxid, gen(strtaxid)
		gen graphval = country + " # {bf:" + strtaxid + "}"
		
		tab graphval
		*Assigning new string as value labels to new numeric variable
		gen introidval=n
		labmask introidval, values(graphval)
		label list



*Generating a "gridline" for highlighted cases
gen line1=-5 if case==1

	 twoway (rbar cstart2 cend2 introidval, horizontal yscale(rev) ///
ylabel(1 4 63, val labsize(vsmall) angle(0) tlength(*1.5)) ymtick(1(1)68, nogrid) ///
xlabel(-5 0 5 (10) 70, labsize(small)) barwidth(0.7) color(gs12) fi(inten100) ///
 xtitle("Years since conflict onset", size(small)) ytitle("") xmtick(-5(1)70) scheme(s1mono) ///
plotregion(margin(1 0.5 1 1)) graphregion(margin(0 5 5 5)) legend(order(2 "War tax in effect" 1 "Conflict episode") size(small) symysize(1pt)) note("Note: The figure includes all 68 war taxes, each represented by a horizontal line," "ordered accoridng to time elapsed between conflict episode start and war tax introduction." "Selected cases are highlighted, along with their tax id." "Source: War Tax dataset 1.0 (2022)", size(2.0)))  ///
(rbar yintro2 ylast2 introidval, horizontal color(black) fi(inten100) barwidth(0.3)) ///
(rspike line1 yintro2 introidval if case==1, ///
horizontal color(black) lpattern(shortdash) lwidth(vthin))


graph export "Figure 3. War taxes, by timing of introduction.png", width(5000) replace





				
				
				
				
				
				
				
				
				
				
				
				
				
***** TABLES *****			
				
				
				
* Main text regression output *

*** Table 1: Logit regressions - war tax in effect

use "fiscal_patriotism.dta", clear




*First, dropping non-at risk obs
drop if atrisk==0 | csample==0


* Model 1: Basic
eststo: logit wt_dum conf_dum5 major_dum5 wt_durlog i.dec, or vce(r)

* Model 2: Conflict-disaggregation
eststo: logit wt_dum conf_dum5 maj_int5 maj_civ5 govsup5 opsup5 interv5 SCNATO wt_durlog i.dec, or vce(r)

* Model 3:Structural conditions
eststo: logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass /// 
i.statecap_qrt wt_durlog i.dec, or vce(r)

* Model 4: Political and economic carachteristics
eststo: logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass ///
 i.statecap_qrt OILprc5 privdef  ///
 nat_ideology protindex wt_durlog i.dec, or vce(r)

*Model 5: Extensive
eststo: logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass ///
 i.statecap_qrt OILprc5 privdef ///
  nat_ideology protindex univ_suf pwr_wealth rel_nr wt_durlog i.dec, or vce(r)



 /* Output to rtf-file:
 
esttab using "fiscal patriotism table 1.rtf", se pr2 b(3) label eform nogaps nobase compress drop(*decade) ///
 title("Table 1: Logit regressions - war tax in effect") ///
 order(conf_dum5 major_dum5 maj_int5 maj_civ5 govsup5 opsup5 interv5 ///
 SCNATO *incclass *statecap_qrt OILprc5 privdef nat_ideology protindex ///
 univ_suf rel_nr pwr_wealth wt_durlog) ///
 addnote("Robust standard errors. Dummies accounting for decade-fixed effects included in all models (not reported)") replace

 
*/
eststo clear
 
 
 
 
 
 
 
 
 
******************** Model results description *************************
 
 
**** Model 1 **** 
*marginal effect
logit wt_dum conf_dum5 major_dum5 wt_durlog i.dec, or vce(r)
predict p

margins, at(conf_dum5=(0 1) major_dum5=0) 
*Conflict: 11% --> 15%
margins, at(major_dum5=(0 1) conf_dum5=(1))
*Major conflict, given conflict: 15% --> 23%
margins, dydx(conf_dum5)


*Duration dependence plot: duration
logit wt_dum conf_dum5 major_dum5 wt_durlog i.dec, or vce(r)
margins, at(wt_durlog=(0(0.1)4)) 
marginsplot
 


  
 
***** Model 2: Conflict-disaggregation 
logit wt_dum conf_dum5 maj_int5 maj_civ5 govsup5 opsup5 interv5 ///
SCNATO wt_durlog i.dec, or vce(r)
 
 *Civil vs. inter-state wars
 margins, at(maj_int5=(0 1) conf_dum5=1)
  margins, at(maj_civ5=(0 1) conf_dum5=1)
 *Inter-state wars have larger effect, but confidence intervals are overlapping
 *for predicted probabilities
 
 *External support
 margins, at(govsup5=(0 1) conf_dum5=1)
 *Gov sup. decreases the probability with around 4 pcnt points.
  margins, at(opsup5=(0 1) conf_dum5=1)
  *Op. sup. increases probability with 2 prcnt points (not sign.)
  
  *Intervention
 margins, at(interv5=(0 1))
  
  *UNSC/NATO
  margins, at(SCNATO=(0 1))
  
 
  
*** Model 3: Structural factors
logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass /// 
i.statecap_qrt wt_durlog i.dec, or vce(r)
margins incclass
tab incclass


*** Model 4: Political/economic factors
logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass ///
 i.statecap_qrt OILprc5 privdef  ///
 nat_ideology protindex wt_durlog i.dec, or vce(r)

margins, at(OILprc5=(0 1))
margins, at(privdef=(0 1))

margins, at(nat_ideology=(0 1))
sum protindex, det
margins, at(protindex=(0 (0.5) 4))



*** Model 5: Extensive
logit wt_dum conf_dum5 major_dum5 SCNATO i.incclass ///
 i.statecap_qrt OILprc5 privdef ///
  nat_ideology protindex univ_suf pwr_wealth rel_nr wt_durlog i.dec, or vce(r)
margins, at(nat_ideology=(0 1))
margins, at(univ_suf=(0 1))
margins, at(pwr_wealth=(0 1))






  


